﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Entity.BaseEntitys

{

    public interface ICreateEntity
    {
        /// <summary>
        /// Create a user
        /// </summary>
        Guid CreateUserId { get; set; }

        /// <summary>
        /// Creation time
        /// </summary>
        DateTime CreateTime { get; set; }
    }


    [Index(nameof(CreateTime), nameof(CreateUserId))]
    public class CreateEntity<TKey> : Entity<TKey>, ICreateEntity, IEntity<TKey>
    {


        public virtual Guid CreateUserId { get; set; }

        public virtual DateTime CreateTime { get; set; } = DateTime.Now;
    }

}